package syntax;

/**
 * Class to interpret characters
 * @author Balazs Pete
 *
 */
public class InterpretCharacter {

	public InterpretCharacter(){
	}
	
	/**
	 * Method to interpret the passed in character, and return an integer specifying it's type
	 * -1 : ordinary character, no special coloring
	 * 0 : operator character
	 * 1 : go down a color level
	 * 2 : go up a color level
	 * 3 : start comments coloring
	 * 4 : stop comments coloring
	 * @param s character (string)
	 * @return integer specifying type
	 * @author Balazs Pete
	 */
	public int interpret(String s){
		char c = s.charAt(0);
		
		switch(c){
		//to specify a new character just insert a new case, if new type is added, extend comments please
		case '(' : return 1;
		case ')' : return 2;
		case '\u2261' : return 0;
		case '\u22C0' : return 0;
		case '\u22C1' : return 0;
		case '\u00AC' : return 0;
		case '\u21D2' : return 0;
		case '\u23BF' : return 0;
		case '\u23CC' : return 0;
		case '\u23BE' : return 0;
		case '\u23CB' : return 0;
		case '\u003C' : return 0;
		case '\u003E' : return 0;
		case '\u2264' : return 0;
		case '\u2265' : return 0;
		case '\u2291' : return 0;
		case '\u2191' : return 0;
		case '\u2193' : return 0;
		case '\u2297' : return 0;
		case '\u2203' : return 0;
		case '\u2200' : return 0;
		case ':' : return 0;
		case '{' : return 3;
		case '}' : return 4;
		case '[' : return 0;
		case ']' : return 0;
		case '.' : return 0;
		case '#' : return 5;
		case '~' : return 6;
		
		default : return -1;
		
		}
	}
	
}
